Some modern compilers, most notably the Java compiler from Sun Microsystems, are designed to compile source code (e.g., Java programs) into sequences of instructions to be executed on a stack-based virtual machine. A key benefit of compiling source code for execution on a virtual machine is that the compiled code may be executed by any processor that can be programmed to implement the virtual machine, regardless of the processor's internal architecture.
One drawback to compiling code for execution on a virtual machine is that execution is usually much slower than if the program had been compiled into native instructions executable by the underlying processor. In a stack-based virtual machine like the Java virtual machine, the stack is usually maintained in system memory so that stack push and pop operations are relatively time consuming and contribute to the relatively slow execution rate of the virtual machine.
Another drawback to compiling code for execution on a virtual machine is that the compiled code tends to be easy to reverse compile into a version of the original source code. This is a serious concern for many software developers. After spending large amounts of time and money developing a software program, developers do not want to place the program in the public domain in a form that gives away the source code.